import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isCollapse: false,
    tabs:[],
    menuList: localStorage.getItem('storeMenuList') || [],
    userDetails: localStorage.getItem('stroeUserDetails') || []
  },
  mutations: {
    switchCollapse (state) {
      state.isCollapse = !state.isCollapse;
    },
    setTabs (state) {
      state.tabs  = state.tabs;
    },
    setMenuList (state,val) {
      state.menuList = val;
      localStorage.setItem('storeMenuList', val)
    },
    setUserDetail (state,val) {
      state.userDetails = val;
      localStorage.setItem('stroeUserDetails', val)
    }
  },
  actions: {

  }
})
